@extends("backend.layout.main")
@section("right_content")
    <style type="text/css">
        * {
            box-sizing: border-box;
        }
    </style>
    <!--middle-->
    <div class="mainWrapBox">
        <div class="mainBox">
			
<h1>
    <a href="/backend/items">项目</a> / {{ $itemsInfo['item_name'] }}
<span class="projects-nav">
<a href="/backend/work/download/{{ $itemsInfo['id'] }}">文档</a>
    <a href="/backend/items/task/{{ $itemsInfo['id'] }}">任务</a>
    <a class="current-nav" href="/backend/items/show/{{ $itemsInfo['id'] }}">基本信息</a>
</span> </h1>
    
    

    <div class="project-main">
    <div class="html mt20">
           <div class="right-part">
                <div class="data-panel panel-height">
                    <h2 class="pl20 pr20">项目位置</h2>
                    <div class="pl20 pr20 mt10" style="height: 350px">
                        <div id="map" style="width: 330px; height: 330px; border: 1px solid rgb(228, 228, 228); display: block;">
                        </div>

                    </div>
                </div>
                <div class="data-panel panel-height mt20">
                    
                </div>
            </div>
            <div class="left-part">
                <div class="data-panel panel-height">

                   <h2 class="pl20 pr20">基本信息
                   @if(session()->get('member')['gid']==1)
                       <ul class="xiansuo_tl" style="float: right">
                           @if($itemsInfo['item_status']<0)
                           <li id="check" data-id="0" onclick="checkItem(this);">发起审核</li>
                           @endif
                           <a href="/backend/items/edit/{{ $itemsInfo['id'] }}"><li id="edit">编辑</li></a>
                       </ul>
                   @else


                    @endif
                   </h2>


                    <table cellpadding="0" cellspacing="0" class="xiansuo_tab" style="margin-left: 20px;width: 90%">
                        <tbody><tr>
                            <td width="140" align="left">意见回复日</td>
                            <td width="350" align="left"> {{ $itemsInfo['idea_deadline'] }}
                            </td>
                            <td width="140" align="left">项目经理：</td>
                            <td width="350" align="left">{{ $name }}</td>
                        </tr>

                        <tr>
                            <td width="140" align="left">情况描述：</td>
                            <td width="350" align="left">{{ $itemsInfo['item_describe'] }}
                            </td>
                            <td width="140" align="left">项目状态：</td>
                            <td width="350" align="left" id="project_status">
                                {{ $itemsInfo['item_status'] }}

                            </td>
                        </tr>
                        <tr>
                            <td width="140" align="left">考核要求：</td>
                            <td width="350" align="left"> {{ $itemsInfo['item_check'] }}</td>
                            <td width="140" align="left">保留价：</td>
                            <td width="350" align="left"> {{ $itemsInfo['item_price'] }}</td>
                        </tr>
                        <tr>
                            <td width="140" align="left">竞价截止日：</td>
                            <td width="350" align="left">{{ $itemsInfo['bidding_deadline'] }}</td>

                            <td width="140" align="left">项目完成日：</td>
                            <td width="350" align="left"> {{ $itemsInfo['item_deadline'] }}</td>
                        </tr>

                        <tr>
                         <td width="140" align="left">约定设计费：</td>
                            <td width="350" align="left">{{ $itemsInfo['item_design'] }}
                            </td>

                            <td width="140" align="left">项目所在地：</td>
                            <td width="350" colspan="3" align="left">
                                {{ $itemsInfo['item_address'] }}
                                     </td>
                            
                        </tr>
                    </tbody></table>
                    <div style="margin-left: 20px;">
                    
                    </div>
                    <div style="margin-left: 20px;">
                        <ul class="xiansuo_wenjian" id="fileNameListId"></ul>
                    </div>

                </div>
                <div class="data-panel panel-height mt20" style="padding: 0 20px 10px 20px">
                    <div class="xiansuo_left_title border_none">
                        <span>审核意见</span>
                    </div>
                    <div id="activity_con">	
<div class="activity-list" data-id="493" data-type="5" data-orgid="5" data-nodeid="2539">

<div class="goutong">






	<div class="goutong_text left">
		<div class="goutong_pic left">
            <img src="{{ session('member')['img'] }}">
			
		</div>
		<div class="goutong_list left" style="width: 1201px;">
			<form action="">
			<input type="hidden" name="activity.pid" value="0">
			<input type="hidden" name="type" value="5">
			<input type="hidden" name="orgId" value="5">
			<input type="hidden" name="nodeId" value="2539">
			<input type="hidden" name="activityForeignId" value="493">
			<div class="goutong_list_tea left">
				<textarea class="gou_te" name="activity.content" style="width: 1200px;"></textarea>
			</div>
			<!--fujian-->
			<div class="fujian_up">
				<ul class="fujing_list uploadSuccessDiv"></ul>
			</div>

			<!--fujian-->
			<div class="goutong_list_bgs left">
				<ul class="goutong_mul">

					<li class="goutong_mul_fujian" onclick="popActivityUpload(this);"></li>
				</ul>

				<div class="goutong_list_fb right">
					<a href="javascript:;" onclick="cancelActivity(this);">取消</a>
					<a class="fabu" data-id="-1" href="javascript:;" onclick="checkItem(this);">发布</a>
				</div>
				<div class="cl"></div>
			</div>
			</form>
		</div>
	</div>
<style>
    #big{
        float: left;
    }


</style>
    <?php
    use App\Model\Backend\Member;


    ?>

@if($itemsInfo['posts'])
    @foreach($itemsInfo['posts'] as $k=>$v)
    <div id='big' style='width:1270px;margin-top:30px;height:100%;'>
        <div class='goutong_pic left'>
            <img src='<?php echo Member::find($v['member_id'])['img'];?>' width='48' height='48' />
        </div>
        <span style='color: #009dc8;font-size: 14px;margin-left: 7px;'>{{ $v['username'] }}</span>
        <div id='times' style='color: #009dc8;width: 141px;height: 19px;float: right;font-size: 12px;'>
           {{ $v['created_at'] }}
        </div><br/>
        <div class='gou_te2'style='width: 1204px;border: 0px;margin-left: 56px;'>
            {{ $v['content'] }}
        </div>
    </div>
    @endforeach
    @endif
    <div class="cl"></div>
</div>
	<div class="cl"></div>
	</div>
</div>

</div>
                </div>
            </div>
        </div>
    </div>

<!-- 上传组件 start -->

</div>


<script type="text/javascript">
   /* $('.fabu').click(function(){

        var action=$(this).data('id');
        alert(action);



    });*/

  function checkItem(obj){
       //alert($(this));
       var action=$(obj).attr('data-id');
      var url="/backend/items/check/{{ $itemsInfo['id'] }}";
       var content=$(".gou_te").val();
      var _Token="{{ csrf_token() }}";
      var img="{{ session('member')['img'] }}";
      var username="{{ session('member')['username'] }}";

       $.post(url,{action:action,content:content,_Token:_Token},function(data){
          if(data==0){
              alert('操作失败，请重试！');
          }else {
              if(action=="0"){
                  $(obj). remove();
                  alert('已通知相关人员处理！' );
              }else{
                  var myDate = new Date();
                  var date=myDate.toLocaleString( );        //获取日期与时间
                  var html="<div id='big' style='width:1270px;margin-top:30px;height:100%;'><div class='goutong_pic left'><img src="+img+" width='48' height='48' /></div><span style='color: #009dc8;font-size: 14px;margin-left: 7px;'>"+username+"</span><div id='times' style='color: #009dc8;width: 141px;height: 19px;float: right;font-size: 12px;'>"+date+"</div><br/><div class='gou_te2'style='width: 1204px;border: 0px;margin-left: 56px;'>"+content+"</div></div>";
                  $(".gou_te").val("");
                  $(".goutong_text.left").after(html);
                  alert('已通知相关人员处理！' );
              }
          }

       },"text");

   }

</script>


        </div>
    </div>
</div>
</div>


@endsection




